package cn.chia.utils;

import java.util.ArrayList;
import java.util.List;

public class FullCountUtil {
	//对传入的购物满减list去重统计
	public static List<FullCount> qCTG(List<FullCount> list){
		List<FullCount> flist = new ArrayList<FullCount>();
		flist.add(list.get(0));
		for (int i = 1; i < list.size(); i++) {
			boolean flag = true;
				
					for (int j = 0; j < flist.size(); j++) {
						if (list.get(i).equals(flist.get(j))) {
							Double jiage = 0.0;
							jiage = list.get(i).getCount()+flist.get(j).getCount();
							flist.get(j).setCount(jiage);
							jiage = 0.0;
							flag = false;
							break;
						}
					}
				
				if (flag) {
				flist.add(list.get(i));
				}
		}
		
		return flist;	
	}
}
